package com.jsb.service;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.jsb.mapper.SysAdminRoleMapper;
import com.jsb.model.SysAdminRole;
import com.jsb.model.SysAdminRoleExample;

@Service
public class SysAdminRoleService{
	
	@Resource
	private SysAdminRoleMapper sysAdminRoleMapper;
	
	public void addSysAdminRole(SysAdminRole sysAdminRole) {
		sysAdminRoleMapper.insertSelective(sysAdminRole);
	}
	
	public void delSysAdminRoleById(String id) {
		sysAdminRoleMapper.deleteByPrimaryKey(id);
	}
	
	public void updateSysAdminRole(SysAdminRole sysAdminRole) {
		sysAdminRoleMapper.updateByPrimaryKeySelective(sysAdminRole);
	}
	
	public void updateSysAdminRoleByExample(SysAdminRole sysAdminRole,SysAdminRoleExample sysAdminRoleExample){
	    sysAdminRoleMapper.updateByExampleSelective(sysAdminRole,sysAdminRoleExample);
	}
	
	public SysAdminRole getSysAdminRoleById(String id) {
		return sysAdminRoleMapper.selectByPrimaryKey(id);
	}
	
	public List<SysAdminRole> getPageSysAdminRole(SysAdminRoleExample sysAdminRoleExample) {
		return sysAdminRoleMapper.selectPage(sysAdminRoleExample);
	}
	
	public int countSysAdminRole(SysAdminRoleExample sysAdminRoleExample) {
		return sysAdminRoleMapper.countByExample(sysAdminRoleExample);
	}
	
	public List<SysAdminRole> selectByExample(SysAdminRoleExample example){
	    return sysAdminRoleMapper.selectByExample(example);
	}
}
